{if $IsProcess neq "Y"}
{include file="top.tpl"}
{literal}  
<script type="text/javascript">

var j = jQuery.noConflict();
j(document).ready(function(){

//if(j(#applicable_for).html()=="" )
//alert("100");

});

function set_category(x)
{
	//alert(x.options[x.options.selectedIndex].value);
	//alert(x.name.charAt(x.name.length-1));
	var b = x.name.charAt(x.name.length-1);
	document.getElementById("go_btn_"+b).href=x.options[x.options.selectedIndex].value;
	
	j.ajax({
   type: "POST",
   url: "applied_for.php",
   data: "id="+b+"&cat="+x.options[x.options.selectedIndex].text.toLowerCase(),
   dataType:"text",
   success: function(msg){
     msg = msg.replace('\n','');
     msg = msg.replace('\r\n','');
	 msg = msg.trim(msg);
	 if(msg=="R")
	{
		msg="Replays";
	 	j("#applicable_for_"+b).text(msg);
	 }
	 if(msg=="C")
	{
		msg="Coach";
	 	j("#applicable_for_"+b).text(msg);
	 }
	 if(msg=="B")
	{
		msg="Both";
	 	j("#applicable_for_"+b).text(msg);
	 }
	 
   }
 });
 
}


</script>
{/literal}
<h2> Games <div id="TransMsgDisplay" align="right" style="height:3px" ></div></h2>
{/if}

<div id="records_listing">	
{if $MessgReportText neq ""}<div align="left" class="successful2" style="color:#FF0000; margin:-25px 0 0 0;">{$MessgReportText}</div>{/if}
				
<div class="newsName">
	<table width="100%" border="0" cellspacing="0" cellpadding="0">
		  <tr>
			<td colspan="7" align="left" valign="top">
				<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#9f9f9f">
				  <tr  bgcolor="#9f9f9f">
					<td  align="left" width="30%" valign="middle" class="padleft">
						<a href="#"  onClick="ManagerGeneral('{$page_name}?action=list_order&do_order=GO&OrderByID=1&OrderType={$OrderType}&{$SearchLink}&from={$from}')" >								
							<span class="whitetext"><strong>Game</strong></span>									
							{$ReturnSortingArr.DisplaySortingImage[1]}				
						</a>	
					</td>
					<td width="30%" class="whitetext" align="center" valign="middle"><strong>Category</strong></td>
					
				
					
					<td width="7%" align="center" class="whitetext" valign="middle"><strong>Active</strong></td>	
					<td width="7%" align="center" class="whitetext" valign="middle"><strong>Default</strong></td>						
					<td width="15%" align="center" class="whitetext" valign="middle"><strong>Actions</strong></td>
				  </tr>
				</table>
			</td>
		</tr>
		 
		<tr>
			<td colspan="7" align="left" valign="top">
				<table width="100%" border="0" cellspacing="1" cellpadding="1" bgcolor="#878787">
				{if $NumSelectCms > 0}
			{section name=RowCms loop=$SelectCmsArr}
			
				  <tr {if ($templatelite.section.RowCms.index % 2) eq 0} bgcolor="#ffffff" {else} bgcolor="#ffffff" {/if}>
					<td  align="left" width="30%" valign="middle" class="simpletxt">
					{$SelectCmsArr[RowCms].game_name}
					</td>
					
					<!-- modified -->
					<td width="15%" align="center" valign="middle">
					<select name="category_{$SelectCmsArr[RowCms].game_id}" id="category_{$SelectCmsArr[RowCms].game_id}"  onchange="set_category(this)">
					<option value="">Select Category</option>
					{if $SelectCmsArr[RowCms].is_ladder eq 'Y'}
					<option value="ladder_manager.php?game_id={$SelectCmsArr[RowCms].game_id}">Ladder</option>
					{/if}
					{if $SelectCmsArr[RowCms].is_race eq 'Y'}
					<option value="race_manager.php?game_id={$SelectCmsArr[RowCms].game_id}">Race</option>
					{/if}
					{if $SelectCmsArr[RowCms].is_server eq 'Y'}
					<option value="server_manager.php?game_id={$SelectCmsArr[RowCms].game_id}">Server</option>
					{/if}
					{if $SelectCmsArr[RowCms].is_region eq 'Y'}
					<option value="region_manager.php?game_id={$SelectCmsArr[RowCms].game_id}">Region</option>
					{/if}
					{if $SelectCmsArr[RowCms].is_rating eq 'Y'}
					<option value="rating_manager.php?game_id={$SelectCmsArr[RowCms].game_id}">Rating</option>
					{/if}
					{if $SelectCmsArr[RowCms].is_versus eq 'Y'}
					<option value="versus_manager.php?game_id={$SelectCmsArr[RowCms].game_id}">Versus</option>
					{/if}
					{if $SelectCmsArr[RowCms].is_team eq 'Y'}
					<option value="team_manager.php?game_id={$SelectCmsArr[RowCms].game_id}">Team</option>
					{/if}
					{if $SelectCmsArr[RowCms].is_type eq 'Y'}
					<option value="type_manager.php?game_id={$SelectCmsArr[RowCms].game_id}">Type</option>
					{/if}
					{if $SelectCmsArr[RowCms].is_champion eq 'Y'}
					<option value="champion_manager.php?game_id={$SelectCmsArr[RowCms].game_id}">Champion</option>
					{/if}
					{if $SelectCmsArr[RowCms].is_map eq 'Y'}
					<option value="map_manager.php?game_id={$SelectCmsArr[RowCms].game_id}">Map</option>
					{/if}
					{if $SelectCmsArr[RowCms].is_mode eq 'Y'}
					<option value="mode_manager.php?game_id={$SelectCmsArr[RowCms].game_id}">Mode</option>
					{/if}
					{if $SelectCmsArr[RowCms].is_class eq 'Y'}
					<option value="class_manager.php?game_id={$SelectCmsArr[RowCms].game_id}">Class</option>
					{/if}
					</select>
					</td>
					
					<td width="10%" align="center">
					<div id="applicable_for_{$SelectCmsArr[RowCms].game_id}"></div>
					</td>
					<td width="5%" align="center">
					<a id="go_btn_{$SelectCmsArr[RowCms].game_id}" href="#"><img src="./images/gobttn.gif" height="20" width="20" /></a>
					</td>
					
	
					<td width="7%" height="28" align="center" valign="middle"><a href="#" onClick="ManagerGeneral('{$page_name}?action=activate&{$PreserveLink}&record_id={$SelectCmsArr[RowCms].game_id}')">
					<img src="images/{$SelectCmsArr[RowCms].active_img}" width="15" height="14" border="0" alt="{$SelectCmsArr[RowCms].active_alt}" /></a></td>
					<td width="7%" height="28" align="center" valign="middle"><a href="#" onClick="ManagerGeneral('{$page_name}?action=default&{$PreserveLink}&record_id={$SelectCmsArr[RowCms].game_id }')">
					<img src="images/{$SelectCmsArr[RowCms].default_img}" width="15" height="14" border="0" alt="{$SelectCmsArr[RowCms].default_alt }" /></a></td>
					<td width="15%" align="center" valign="middle">
					  <table width="100%" border="0" cellspacing="0" cellpadding="0">
						  <tr>
						  <td width="50%" height="32" align="center" valign="middle" class="rightBorder" >
						  <a href="game_update.php?game_id={$SelectCmsArr[RowCms].game_id}">
						  <img src="images/edit_dark.gif" alt="" width="15" height="14" border="0" />
						  </a>
						  </td>
						  
						  <td width="50%" align="center" valign="middle">
						  <a href="#" onClick="ConfirmDelete('{$page_name}?action=del&{$PreserveLink}','{$SelectCmsArr[RowCms].game_id}','{$SelectCmsArr[RowCms].game_name_delete}','Language:: ')">
						  <img src ="images/delete_icon.gif" border="0" alt="" />
						  </a >
						  </td >
						  </tr >
					</table>					
					</td >
				 </tr>
				  {/section}
			{else}
				<tr bgcolor="#f4f4f5"><td class="plaintxt" colspan="5" align="center">No Record Found</td></tr>
			{/if}       
				  
				 
			  </table>
			</td >
		  </tr >
		  
  </table >
</div>
<br />
<div>	{if $pagination_arr[3] > 0}
   <table>
	  <tr>
        <td height="30" valign="middle" align="center">
			<table border="0" cellspacing="0" cellpadding="0" width="100%">
				<tr>
					<td align="left" class="plaintxt">					
					{if $pagination_arr[2] neq ""}					
						{$pagination_arr[2]}
					{/if}					
					</td>
					<td align="right" class="plaintxt">					   	
					{if $pagination_arr[1] neq ""}					
						{$pagination_arr[1]}
					{/if}					
					</td>
				</tr>
			</table>
		</td>
      </tr>
	  </table>
	{/if} </div>
</div>

{if $IsProcess neq "Y"}  	
{include file="bottom.tpl"}
{/if}
